package com.gaoyi.websocket.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gaoyi.websocket.entity.TblNews;
import com.gaoyi.websocket.mapper.TblNewsMapper;
import com.gaoyi.websocket.service.TblNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liaojunhui
 * @since 2021-03-19
 */
@Service
public class TblNewsServiceImpl extends ServiceImpl<TblNewsMapper, TblNews> implements TblNewsService {

    @Autowired
    TblNewsMapper tblNewsMapper;

    @Override
    public List<TblNews> queryByStr(String title) {
        return tblNewsMapper.selectByStr(title);
    }

    @Override
    public List<TblNews> getAllNews() {
        List<TblNews> list = tblNewsMapper.selectAll();
        return list;
    }

    @Override
    public TblNews nextNews(Integer titleId) {
        return tblNewsMapper.nextNews(titleId);
    }

    @Override
    public TblNews preNews(Integer titleId) {
        return tblNewsMapper.preNews(titleId);
    }

}
